<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>


<%@ page contentType="text/html; charset=UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html>
<html>
<head>
    <title>信息统计</title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/Css/bootstrap.css"/>
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/Css/bootstrap-responsive.css"/>
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/Css/style.css"/>
    <link href="<%=request.getContextPath()%>/Css/jquery-ui.min.css"
          type="text/css" rel="stylesheet"/>
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery2.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery2.sorted.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/bootstrap.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/ckform.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/common.js"></script>
    <script type="text/javascript"
            src="<%=request.getContextPath()%>/js/jquery-ui.min.js"></script>
    <script
            src="<%=request.getContextPath()%>/js/My97DatePicker/WdatePicker.js"></script>
    <style type="text/css">
        table {
            table-layout: fixed; /* 只有定义了表格的布局算法为fixed，下面td的定义才能起作用。 */
        }

        #messageTable td {
            width: 100%;
            word-break: keep-all; /* 不换行 */
            white-space: nowrap; /* 不换行 */
            overflow: hidden; /* 内容超出宽度时隐藏超出部分的内容 */
            text-overflow: ellipsis;
            /* 当对象内文本溢出时显示省略标记(...) ；需与overflow:hidden;一起使用*/
        }


    </style>
</head>
<body>
<form id="queryForm" class="form-inline definewidth m20" action="/" method="post">

    <p>
    <label> <span>用户类别: </span>
        <select id="playerRole" name="playerRole">
            <option value="1" <c:if test="${paramMap.playerRole==1}">selected="selected"</c:if> >玩家</option>
            <option value="2" <c:if test="${paramMap.playerRole==2}">selected="selected"</c:if>>管理员</option>
        </select>
    </label>


    <label> <span>行为类别: </span>
        <select id="queryType" name="queryType">
            <option value="1" <c:if test="${paramMap.queryType==1}">selected="selected"</c:if>>充值</option>
            <option value="0" <c:if test="${paramMap.queryType==0}">selected="selected"</c:if> >消费</option>
        </select>
    </label>
    </p>
    <p>
    <label> <span>时间区间:
			</span><input class="text-input small-input" type="text" id="begintime"
            name="begintime" value="${paramMap.begintime}"  onclick="WdatePicker({startDate:'%y-%M-%d'})"
            onFocus="WdatePicker({startDate:'%y-%M-%d %H:%m:%s',maxDate:'#F{$dp.$D(\'endtime\')}',minDate:'#F{$dp.$D(\'endtime\',{d:-32})}',dateFmt:'yyyy-MM-dd',alwaysUseStartDate:true})"
            readonly="readonly" />~~~

        <input class="text-input small-input"
            type="text" id="endtime" name="endtime" value="${paramMap.endtime}" onclick="WdatePicker({startDate:'%y-%M-{%d+1}'})"
            onFocus="WdatePicker({startDate:'%y-%M-%d %H:%m:%s',maxDate:'#F{$dp.$D(\'begintime\',{d:+32})}',minDate:'#F{$dp.$D(\'begintime\')}',dateFmt:'yyyy-MM-dd',alwaysUseStartDate:true})"
            readonly="readonly" />
    </label>
    </p>
    <button type="button" class="btn btn-primary" onclick="queryStaticInfo();">查询</button>
</form>


<div class="table table-bordered table-hover definewidth m10" style="padding-top: 20px;background-color:darkolivegreen;height: 30px;" align="right">
    <c:forEach items="${allIncomeInfo}" var="allInfo" >
        <c:if test="${allInfo.playerRole==1}">
            <div class="span">向用户充值总额：<font size="6" id="playerIdTxt">${allInfo.diamond} </font></div>
        </c:if>
        <c:if test="${allInfo.playerRole==2}">
            <div class="span3">向代理充值总额：<font size="6" id="22">${allInfo.diamond}</font></div>
        </c:if>
        <c:if test="${allInfo.playerRole==3}">
            <div class="span3">消费总额：<font size="6"  id="11">${allInfo.diamond}</font></div>
        </c:if>
    </c:forEach>
    </label>
</div>
<div>
<table id="messageTable" class="table table-bordered table-hover definewidth m10">

    <thead>
    <tr>
        <th width="10%">序号</th>
        <th width="25%">类别</th>
        <th width="25%">钻石</th>
        <th width="40%">时间</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${eachDayInfo}" var="dayInfo" varStatus="dataStatus">
        <tr>
            <td>${dataStatus.index+1}</td>
            <td >
            <c:if test="${dayInfo.playerRole==2}">
                充值给代理
            </c:if>
            <c:if test="${dayInfo.playerRole==1}">
                充值给玩家
            </c:if>
            <c:if test="${dayInfo.playerRole==3}">
                玩家消费
            </c:if>
            </td>
            <td title="${dayInfo.diamond}">${dayInfo.diamond}</td>
            <td>${dayInfo.byDate}</td>
        </tr>
    </c:forEach>
    </tbody>
    <tfoot>
    <tr bgcolor="EEF7FE">

        <td colspan="14" bgcolor="EEF7FE" class="f">
            <c:forEach items="${showDayDiamond}" var="showDiamnond" >
                <c:if test="${showDiamnond.playerRole==1}">
                    <div class="span">用户充值总计：<font size="6" >${showDiamnond.queryDiamond} </font></div>
                </c:if>
                <c:if test="${showDiamnond.playerRole==2}">
                    <div class="span3">向代理充值总计：<font size="6" >${showDiamnond.queryDiamond}</font></div>
                </c:if>
                <c:if test="${showDiamnond.playerRole==3}">
                    <div class="span3">消费总计：<font size="6"  >${showDiamnond.queryDiamond}</font></div>
                </c:if>
            </c:forEach>

        </td>


       <%-- <td colspan="14" bgcolor="EEF7FE" class="f">
            <div align="right" style="bgcolor:EEF7FE" class="f">
                <jsp:include page="/common/pageUtil.jsp"></jsp:include>
            </div>
        </td>--%>
    </tr>
    </tfoot>
</table>
</div>
</body>
<script type="text/javascript">


    function queryStaticInfo(){
        if($("#begintime").val()==''||$("#endtime").val()==''){
            alert("请选择开始或者结束时间");
           return ;
        }

        var form = document.getElementById("queryForm");
        form.action = "<%=request.getContextPath()%>/game/statisticsByDay.html";
        form.submit();

    }

</script>

</html>